import {
  ParamsType,
  ProColumns,
  ProTable,

} from '@ant-design/pro-components';
import { Modal } from 'antd';
import React from 'react';

export type Props = {
  columns: ProColumns<API.CurrentUser>[];
  onCancel: () => void;
  onSubmit: (values: ParamsType) => Promise<void>;
  visible: boolean;
};
const CreateModel: React.FC<Props> = (props) => {
  const {visible,columns,onCancel,onSubmit} = props;
  return (
    <Modal visible={visible} footer={null} onCancel={()=>onCancel?.()}>
      <ProTable type="form" columns={columns}
                onSubmit={async (value) => {
                  onSubmit?.(value);
                  }}
      />
    </Modal>
  );
};
export default CreateModel;
